import static org.junit.Assert.*;

import org.junit.Test;

public class MainTest {



	@Test
	public void testAhmetErdem() {		

		assertTrue("x^2 -1 is always greater than -1 and since there is %6 the function must return an integer less than 6.",
				Main.AhmetErdem(220)<6&&Main.AhmetErdem(220)>=-1);
	}

	@Test
	public void testAhmetCelik() {
		/* For all inputs x's , ouputs are either (x-4) or (x+7)*/
		int result=Main.AhmetCelik(8);
		assertTrue("Input: 8  Possible Outputs: 15 or 4",(result==4 || result==15));
		result=Main.AhmetCelik(0);
		assertTrue("Input: 0  Possible Outputs: -4 or 7",(result==-4 || result==7));
		result=0;
		for(int i=0;i<10;i++)
			result+= (i&1)==0 ? -Main.AhmetCelik(1907) : Main.AhmetCelik(1907);
		assertTrue("I add +/- of the results,hence x's cancel each other. Results can be in interval [-55,55]. Also (result+55)%11 must be 0.",
				(result>=-55 && result<=55)&&( (result+55)%11 == 0));
	}

	@Test
	public void testBuketNazlican() {
	
		assertTrue("7 is odd, 7 x 3 +1 is 22",Main.BuketNazlican(7)==22);
	
		assertTrue("16 is even 16/2 is 8 ",Main.BuketNazlican(16)==8);
	}

	@Test
	public void testBerkeCanGurer() {

		assertTrue(Main.BerkeCanGurer(17)==17);
	}

	@Test
	public void testNazireAslan() {

		assertTrue("9 > 7 then 7 is returned",Main.NazireAslan(9)==7);
		
	}

	@Test
	public void testTalhaKaya() {
		assertTrue("9 corresponds to g. It's converted to integer and returned.",Main.TalhaKaya(9)==(int) 'g');
		assertTrue("1 corresponds to p. It's converted to integer and returned.",Main.TalhaKaya(1)==(int) 'p');
	}

	@Test
	public void testSerkanOzer() {
		assertTrue("next power of two larger than 53 is 64",Main.SerkanOzer(53)==64);
	}

	@Test
	public void testKivancUnal() {
		
		assertTrue(Main.KivancUnal(2)==2);
	}

	@Test
	public void testAhmadZafar() {
	
		assertTrue("6th fibonacci number is 13",Main.AhmadZafar(6)==13);
		assertTrue("fibonacci numbers after 50th is not calculated, 0 is returned",Main.AhmadZafar(51)==0);
	}

}
